const mongoose = require('mongoose')
const Schema = mongoose.Schema
const vipSchema = new Schema({
  type: {
    type: Schema.Types.ObjectId,
    ref: 'vipType'
  },
  cardNo: String,
  activationDate: Date,
  expireDate: Date,
  linkUser: {
    type: Schema.Types.ObjectId,
    ref: 'user'
  },
  linkSaler: {
    type: Schema.Types.ObjectId,
    ref: 'saler'
  },
  createRecord: {
    type: Schema.Types.ObjectId,
    ref: 'vipCreateRecord'
  },
  createAt: {
    type: Date,
    default: new Date()
  }
})

mongoose.model('vip', vipSchema)
